﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;
using ZFCNew.ViewModels;

namespace ZFCNew
{
    public partial class News : Page
    {
        public static ZfcPreloaer Loaer { get; private set; }
        public News()
        {
            InitializeComponent();
            Loaer = Preloaer;
            Loaded += new RoutedEventHandler(Info_Loaded);
        }

        void Info_Loaded(object sender, RoutedEventArgs e)
        {
            NavFacebook.IsChecked = true;
            
        }

        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
        }

        private void NavFacebook_Checked(object sender, RoutedEventArgs e)
        {
            ((FacebookSearchModel)FBSearch.LayoutRoot.DataContext).GeneralSearchCommand.Execute("");
        }

        private void NavTwitter_Checked(object sender, RoutedEventArgs e)
        {
            ((TwitterSearchModel)TwittSearch.LayoutRoot.DataContext).GeneralSearchCommand.Execute("");
        }

        private void NavZFC_Checked(object sender, RoutedEventArgs e)
        {

        }

        private void NavFeed_Checked(object sender, RoutedEventArgs e)
        {
            ((FeedReaderModel)FeedCtrl.LayoutRoot.DataContext).DownloadFeed("http://www.fifa.com/worldcup/news/rss.xml");            
        }
    }
}
